diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index bdb058e..fe55e36 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -1,503 +1,503 @@
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
-/**
- * Code Igniter
- *
- * An open source application development framework for PHP 4.3.2 or newer
- *
- * @package		CodeIgniter
- * @author		Rick Ellis, Paul Burdick
- * @copyright	Copyright (c) 2006, pMachine, Inc.
- * @license		http://www.codeignitor.com/user_guide/license.html
- * @link		http://www.codeigniter.com
- * @since		Version 1.0
- * @filesource
- */
-
-if ( ! function_exists('xml_parser_create'))
-{	
-	show_error('Your PHP installation does not support XML');
-}
-
-if ( ! class_exists('CI_Xmlrpc'))
-{
-	show_error('You must load the Xmlrpc class before loading the Xmlrpcs class in order to create a server.');
-}
-
-// ------------------------------------------------------------------------
-
-/**
- * XML-RPC server class
- *
- * @package		CodeIgniter
- * @subpackage	Libraries
- * @category	XML-RPC
- * @author		Paul Burdick
- * @link		http://www.codeigniter.com/user_guide/libraries/xmlrpc.html
- */
-class CI_Xmlrpcs extends CI_Xmlrpc
-{
-	var $methods		= array(); 	//array of methods mapped to function names and signatures
-	var $debug_msg		= '';		// Debug Message
-	var $system_methods = array(); // XML RPC Server methods
-	var $controller_obj;
-
-
-	//-------------------------------------
-	//  Constructor, more or less
-	//-------------------------------------
-
-	function CI_Xmlrpcs($config=array())
-	{	
-		parent::CI_Xmlrpc();
-		$this->set_system_methods();
-	
-		if (isset($config['functions']) && is_array($config['functions']))
-		{
-			$this->methods = $config['functions'];
-		}
-		
-		log_message('debug', "XML-RPC Server Class Initialized");
-	}
-	
-	//-------------------------------------
-	//  Initialize Prefs and Serve
-	//-------------------------------------
-	
-	function initialize($config=array())
-	{	
-		if (isset($config['functions']) && is_array($config['functions']))
-		{
-			$this->methods = $config['functions'];
-		}
-		
-		if (isset($config['debug']))
-		{
-			$this->debug = $config['debug'];
-		}
-	}
-	
-	//-------------------------------------
-	//  Setting of System Methods
-	//-------------------------------------
-	
-	function set_system_methods ()
-	{
-		$system_methods = array(
-		'system.listMethods' => array(
-			'function' => 'this.listMethods',
-			'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString), array($this->xmlrpcArray)),
-			'docstring' => 'Returns an array of available methods on this server'),
-		'system.methodHelp' => array(
-			'function' => 'this.methodHelp',
-			'signature' => array(array($this->xmlrpcString, $this->xmlrpcString)),
-			'docstring' => 'Returns a documentation string for the specified method'),
-		'system.methodSignature' => array(
-			'function' => 'this.methodSignature',
-			'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString)),
-			'docstring' => 'Returns an array describing the return type and required parameters of a method'),
-		'system.multicall' => array(
-			'function' => 'this.multicall',
-			'signature' => array(array($this->xmlrpcArray, $this->xmlrpcArray)),
-			'docstring' => 'Combine multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader$1208 for details')
-		);
-	}
-
-
-	//-------------------------------------
-	//  Main Server Function
-	//-------------------------------------
-	
-	function serve()
-	{
-		$r = $this->parseRequest();
-		$payload  = '<?xml version="1.0" encoding="'.$this->xmlrpc_defencoding.'"?'.'>'."\n";
-		$payload .= $this->debug_msg;
-		$payload .= $r->prepare_response();
-		
-		header("Content-Type: text/xml");
-		header("Content-Length: ".strlen($payload));
-		echo $payload;
-	}
-
-	//-------------------------------------
-	//  Add Method to Class
-	//-------------------------------------
-	
-	function add_to_map($methodname,$function,$sig,$doc)
-	{
-		$this->methods[$methodname] = array(
-			'function'  => $function,
-			'signature' => $sig,
-			'docstring' => $doc
-		);
-	}
-
-
-	//-------------------------------------
-	//  Parse Server Request
-	//-------------------------------------
-	
-	function parseRequest($data='')
-	{
-		global $HTTP_RAW_POST_DATA;
-		
-		//-------------------------------------
-		//  Get Data
-		//-------------------------------------
-
-		if ($data == '')
-		{
-			$data = $HTTP_RAW_POST_DATA;
-		}
-
-
-		//-------------------------------------
-		//  Set up XML Parser
-		//-------------------------------------
-		
-		$parser = xml_parser_create($this->xmlrpc_defencoding);
-		$parser_object = new XML_RPC_Message("filler");
-		
-		$parser_object->xh[$parser]					= array();
-		$parser_object->xh[$parser]['isf']			= 0;
-		$parser_object->xh[$parser]['isf_reason']	= '';
-		$parser_object->xh[$parser]['params']		= array();
-		$parser_object->xh[$parser]['stack']		= array();
-		$parser_object->xh[$parser]['valuestack']	= array();
-		$parser_object->xh[$parser]['method']		= '';
-
-		xml_set_object($parser, $parser_object);
-		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
-		xml_set_element_handler($parser, 'open_tag', 'closing_tag');
-		xml_set_character_data_handler($parser, 'character_data');
-		//xml_set_default_handler($parser, 'default_handler');
-		
-		
-		//-------------------------------------
-		//  PARSE + PROCESS XML DATA
-		//-------------------------------------  	
-		
-		if ( ! xml_parse($parser, $data, 1))
-		{
-			// return XML error as a faultCode
-			$r = new XML_RPC_Response(0,
-			$this->xmlrpcerrxml + xml_get_error_code($parser),
-			sprintf('XML error: %s at line %d',
-				xml_error_string(xml_get_error_code($parser)),
-				xml_get_current_line_number($parser)));
-			xml_parser_free($parser);
-		}
-		elseif($parser_object->xh[$parser]['isf'])
-		{
-			return new XML_RPC_Response(0,
-										$this->xmlrpcerr['invalid_return'],
-										$this->xmlrpcstr['invalid_retrun']);
-		}
-		else
-		{
-			xml_parser_free($parser);
-			
-			$m = new XML_RPC_Message($parser_object->xh[$parser]['method']);
-			$plist='';
-			
-			for($i=0; $i < sizeof($parser_object->xh[$parser]['params']); $i++)
-			{
-				$plist .= "$i - " .  print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n";
-				
-				$m->addParam($parser_object->xh[$parser]['params'][$i]);
-			}
-			
-			if ($this->debug === TRUE)
-			{
-				echo "<pre>";
-				echo "---PLIST---\n" . $plist . "\n---PLIST END---\n\n";
-				echo "</pre>";
-			}
-			
-			$r = $this->_execute($m);
-		}
-		
-		//-------------------------------------
-		//  SET DEBUGGING MESSAGE
-		//-------------------------------------  	
-		
-		if ($this->debug === TRUE)
-		{
-			$this->debug_msg = "<!-- DEBUG INFO:\n\n".$plist."\n END DEBUG-->\n";
-		}
-		
-		return $r;
-	}
-
-	//-------------------------------------
-	//  Executes the Method
-	//-------------------------------------
-	
-	function _execute($m)
-	{
-		$methName = $m->method_name;
-		
-		// Check to see if it is a system call
-		// If so, load the system_methods
-		$sysCall = ereg("^system\.", $methName);
-		$methods = $sysCall ? $this->system_methods : $this->methods;
-		
-		//-------------------------------------
-		//  Check for Function
-		//-------------------------------------
-		
-		if (!isset($methods[$methName]['function']))
-		{
-			return new XML_RPC_Response(0,
-				$this->xmlrpcerr['unknown_method'],
-				$this->xmlrpcstr['unknown_method']);
-		}
-		else
-		{
-			// See if we are calling function in an object
-			
-			$method_parts = explode(".",$methods[$methName]['function']);
-			$objectCall = (isset($method_parts['1']) && $method_parts['1'] != "") ? true : false;
-			
-			if ($objectCall && !is_callable(array($method_parts['0'],$method_parts['1'])))
-			{
-				return new XML_RPC_Response(0,
-				$this->xmlrpcerr['unknown_method'],
-				$this->xmlrpcstr['unknown_method']);
-			}
-			elseif (!$objectCall && !is_callable($methods[$methName]['function']))
-			{
-				return new XML_RPC_Response(0,
-					$this->xmlrpcerr['unknown_method'],
-					$this->xmlrpcstr['unknown_method']);
-			}		
-		}
-
-		//-------------------------------------
-		//  Checking Methods Signature
-		//-------------------------------------
-		
-		if (isset($methods[$methName]['signature']))
-		{
-			$sig = $methods[$methName]['signature'];
-			for($i=0; $i<sizeof($sig); $i++)
-			{
-				$current_sig = $sig[$i];
-		
-				if (sizeof($current_sig) == sizeof($m->params)+1)
-				{
-					for($n=0; $n < sizeof($m->params); $n++)
-					{
-						$p = $m->params[$n];
-						$pt = ($p->kindOf() == 'scalar') ? $p->scalartyp() : $p->kindOf();
-						
-						if ($pt != $current_sig[$n+1])
-						{
-							$pno = $n+1;
-							$wanted = $current_sig[$n+1];
-							
-							return new XML_RPC_Response(0,
-								$this->xmlrpcerr['incorrect_params'],
-								$this->xmlrpcstr['incorrect_params'] .
-								": Wanted {$wanted}, got {$pt} at param {$pno})");
-						}
-					}
-				}
-			}
-		}
-
-		//-------------------------------------
-		//  Calls the Function
-		//-------------------------------------
-
-		if ($objectCall)
-		{
-			if ($method_parts['1'] == "this")
-			{
-				return call_user_func(array($this, $method_parts['0']), $m);
-			}
-			else
-			{
-				$CI =& get_instance();
-				return $CI->$method_parts['1']($m);
-				//$class = new $method_parts['0'];
-				//return $class->$method_parts['1']($m);
-				//return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m);
-			}
-		}
-		else
-		{
-			return call_user_func($methods[$methName]['function'], $m);
-		}
-	}
-	
-	
-	//-------------------------------------
-	//  Server Function:  List Methods
-	//-------------------------------------
-	
-	function listMethods($m)
-	{
-		$v = new XML_RPC_Values();
-		$output = array();
-		foreach($this->$methods as $key => $value)
-		{
-			$output[] = new XML_RPC_Values($key, 'string');
-		}
-		
-		foreach($this->system_methods as $key => $value)
-		{
-			$output[]= new XML_RPC_Values($key, 'string');
-		}
-
-		$v->addArray($output);
-		return new XML_RPC_Response($v);
-	}
-	
-	//-------------------------------------
-	//  Server Function:  Return Signature for Method
-	//-------------------------------------
-		
-	function methodSignature($m)
-	{
-		$methName = $m->getParam(0);
-		$method_name = $methName->scalarval();
-		
-		$methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods;
-		
-		if (isset($methods[$method_name]))
-		{
-			if ($methods[$method_name]['signature'])
-			{
-				$sigs = array();
-				$signature = $methods[$method_name]['signature'];
-				
-				for($i=0; $i < sizeof($signature); $i++)
-				{
-					$cursig = array();
-					$inSig = $signature[$i];
-					for($j=0; $j<sizeof($inSig); $j++)
-					{
-						$cursig[]= new XML_RPC_Values($inSig[$j], 'string');
-					}
-					$sigs[]= new XML_RPC_Values($cursig, 'array');
-				}
-				$r = new XML_RPC_Response(new XML_RPC_Values($sigs, 'array'));
-			}
-			else
-			{
-				$r = new XML_RPC_Response(new XML_RPC_Values('undef', 'string'));
-			}
-		}
-		else
-		{
-			$r = new XML_RPC_Response(0,$this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']);
-		}
-		return $r;
-	}
-	
-	//-------------------------------------
-	//  Server Function:  Doc String for Method
-	//-------------------------------------
-	
-	function methodHelp($m)
-	{
-		$methName = $m->getParam(0);
-		$method_name = $methName->scalarval();
-		
-		$methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods;
-	
-		if (isset($methods[$methName]))
-		{
-			$docstring = isset($methods[$method_name]['docstring']) ? $methods[$method_name]['docstring'] : '';
-			$r = new XML_RPC_Response(new XML_RPC_Values($docstring, 'string'));
-		}
-		else
-		{
-			$r = new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']);
-		}
-		return $r;
-	}
-
-	//-------------------------------------
-	//  Server Function:  Multi-call
-	//-------------------------------------
-
-	function multicall($m)
-	{
-		$calls = $m->getParam(0);
-		list($a,$b)=each($calls->me);
-		$result = array();
-
-		for ($i = 0; $i < sizeof($b); $i++)
-		{
-			$call = $calls->me['array'][$i];
-			$result[$i] = $this->do_multicall($call);
-		}
-
-		return new XML_RPC_Response(new XML_RPC_Values($result, 'array'));
-	}
-	
-	
-	//-------------------------------------
-	//  Multi-call Function:  Error Handling
-	//-------------------------------------
-
-	function multicall_error($err)
-	{
-		$str  = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString();
-		$code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode();
-		
-		$struct['faultCode'] = new XML_RPC_Values($code, 'int');
-		$struct['faultString'] = new XML_RPC_Values($str, 'string');
-	
-		return new XML_RPC_Values($struct, 'struct');
-	}
-	
-	
-	//-------------------------------------
-	//  Multi-call Function:  Processes method
-	//-------------------------------------
-	
-	function do_multicall($call)
-	{
-		if ($call->kindOf() != 'struct')
-			return $this->multicall_error('notstruct');
-		elseif (!$methName = $call->me['struct']['methodName'])
-			return $this->multicall_error('nomethod');
-		
-		list($scalar_type,$scalar_value)=each($methName->me);
-		$scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type;
-			
-		if ($methName->kindOf() != 'scalar' || $scalar_type != 'string')
-			return $this->multicall_error('notstring');
-		elseif ($scalar_value == 'system.multicall')
-			return $this->multicall_error('recursion');
-		elseif (!$params = $call->me['struct']['params'])
-			return $this->multicall_error('noparams');
-		elseif ($params->kindOf() != 'array')
-			return $this->multicall_error('notarray');
-			
-		list($a,$b)=each($params->me);
-		$numParams = sizeof($b);
-
-		$msg = new XML_RPC_Message($scalar_value);
-		for ($i = 0; $i < $numParams; $i++)
-		{
-			$msg->params[] = $params->me['array'][$i];
-		}
-
-		$result = $this->_execute($msg);
-
-		if ($result->faultCode() != 0)
-		{
-			return $this->multicall_error($result);
-		}
-
-		return new XML_RPC_Values(array($result->value()), 'array');
-	}	
-	
-}
-// END XML_RPC_Server class
-
+<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 4.3.2 or newer
+ *
+ * @package		CodeIgniter
+ * @author		Rick Ellis, Paul Burdick
+ * @copyright	Copyright (c) 2006, EllisLab, Inc.
+ * @license		http://www.codeignitor.com/user_guide/license.html
+ * @link		http://www.codeigniter.com
+ * @since		Version 1.0
+ * @filesource
+ */
+
+if ( ! function_exists('xml_parser_create'))
+{	
+	show_error('Your PHP installation does not support XML');
+}
+
+if ( ! class_exists('CI_Xmlrpc'))
+{
+	show_error('You must load the Xmlrpc class before loading the Xmlrpcs class in order to create a server.');
+}
+
+// ------------------------------------------------------------------------
+
+/**
+ * XML-RPC server class
+ *
+ * @package		CodeIgniter
+ * @subpackage	Libraries
+ * @category	XML-RPC
+ * @author		Paul Burdick
+ * @link		http://www.codeigniter.com/user_guide/libraries/xmlrpc.html
+ */
+class CI_Xmlrpcs extends CI_Xmlrpc
+{
+	var $methods		= array(); 	//array of methods mapped to function names and signatures
+	var $debug_msg		= '';		// Debug Message
+	var $system_methods = array(); // XML RPC Server methods
+	var $controller_obj;
+
+
+	//-------------------------------------
+	//  Constructor, more or less
+	//-------------------------------------
+
+	function CI_Xmlrpcs($config=array())
+	{	
+		parent::CI_Xmlrpc();
+		$this->set_system_methods();
+	
+		if (isset($config['functions']) && is_array($config['functions']))
+		{
+			$this->methods = $config['functions'];
+		}
+		
+		log_message('debug', "XML-RPC Server Class Initialized");
+	}
+	
+	//-------------------------------------
+	//  Initialize Prefs and Serve
+	//-------------------------------------
+	
+	function initialize($config=array())
+	{	
+		if (isset($config['functions']) && is_array($config['functions']))
+		{
+			$this->methods = $config['functions'];
+		}
+		
+		if (isset($config['debug']))
+		{
+			$this->debug = $config['debug'];
+		}
+	}
+	
+	//-------------------------------------
+	//  Setting of System Methods
+	//-------------------------------------
+	
+	function set_system_methods ()
+	{
+		$system_methods = array(
+		'system.listMethods' => array(
+			'function' => 'this.listMethods',
+			'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString), array($this->xmlrpcArray)),
+			'docstring' => 'Returns an array of available methods on this server'),
+		'system.methodHelp' => array(
+			'function' => 'this.methodHelp',
+			'signature' => array(array($this->xmlrpcString, $this->xmlrpcString)),
+			'docstring' => 'Returns a documentation string for the specified method'),
+		'system.methodSignature' => array(
+			'function' => 'this.methodSignature',
+			'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString)),
+			'docstring' => 'Returns an array describing the return type and required parameters of a method'),
+		'system.multicall' => array(
+			'function' => 'this.multicall',
+			'signature' => array(array($this->xmlrpcArray, $this->xmlrpcArray)),
+			'docstring' => 'Combine multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader$1208 for details')
+		);
+	}
+
+
+	//-------------------------------------
+	//  Main Server Function
+	//-------------------------------------
+	
+	function serve()
+	{
+		$r = $this->parseRequest();
+		$payload  = '<?xml version="1.0" encoding="'.$this->xmlrpc_defencoding.'"?'.'>'."\n";
+		$payload .= $this->debug_msg;
+		$payload .= $r->prepare_response();
+		
+		header("Content-Type: text/xml");
+		header("Content-Length: ".strlen($payload));
+		echo $payload;
+	}
+
+	//-------------------------------------
+	//  Add Method to Class
+	//-------------------------------------
+	
+	function add_to_map($methodname,$function,$sig,$doc)
+	{
+		$this->methods[$methodname] = array(
+			'function'  => $function,
+			'signature' => $sig,
+			'docstring' => $doc
+		);
+	}
+
+
+	//-------------------------------------
+	//  Parse Server Request
+	//-------------------------------------
+	
+	function parseRequest($data='')
+	{
+		global $HTTP_RAW_POST_DATA;
+		
+		//-------------------------------------
+		//  Get Data
+		//-------------------------------------
+
+		if ($data == '')
+		{
+			$data = $HTTP_RAW_POST_DATA;
+		}
+
+
+		//-------------------------------------
+		//  Set up XML Parser
+		//-------------------------------------
+		
+		$parser = xml_parser_create($this->xmlrpc_defencoding);
+		$parser_object = new XML_RPC_Message("filler");
+		
+		$parser_object->xh[$parser]					= array();
+		$parser_object->xh[$parser]['isf']			= 0;
+		$parser_object->xh[$parser]['isf_reason']	= '';
+		$parser_object->xh[$parser]['params']		= array();
+		$parser_object->xh[$parser]['stack']		= array();
+		$parser_object->xh[$parser]['valuestack']	= array();
+		$parser_object->xh[$parser]['method']		= '';
+
+		xml_set_object($parser, $parser_object);
+		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
+		xml_set_element_handler($parser, 'open_tag', 'closing_tag');
+		xml_set_character_data_handler($parser, 'character_data');
+		//xml_set_default_handler($parser, 'default_handler');
+		
+		
+		//-------------------------------------
+		//  PARSE + PROCESS XML DATA
+		//-------------------------------------  	
+		
+		if ( ! xml_parse($parser, $data, 1))
+		{
+			// return XML error as a faultCode
+			$r = new XML_RPC_Response(0,
+			$this->xmlrpcerrxml + xml_get_error_code($parser),
+			sprintf('XML error: %s at line %d',
+				xml_error_string(xml_get_error_code($parser)),
+				xml_get_current_line_number($parser)));
+			xml_parser_free($parser);
+		}
+		elseif($parser_object->xh[$parser]['isf'])
+		{
+			return new XML_RPC_Response(0,
+										$this->xmlrpcerr['invalid_return'],
+										$this->xmlrpcstr['invalid_retrun']);
+		}
+		else
+		{
+			xml_parser_free($parser);
+			
+			$m = new XML_RPC_Message($parser_object->xh[$parser]['method']);
+			$plist='';
+			
+			for($i=0; $i < sizeof($parser_object->xh[$parser]['params']); $i++)
+			{
+				$plist .= "$i - " .  print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n";
+				
+				$m->addParam($parser_object->xh[$parser]['params'][$i]);
+			}
+			
+			if ($this->debug === TRUE)
+			{
+				echo "<pre>";
+				echo "---PLIST---\n" . $plist . "\n---PLIST END---\n\n";
+				echo "</pre>";
+			}
+			
+			$r = $this->_execute($m);
+		}
+		
+		//-------------------------------------
+		//  SET DEBUGGING MESSAGE
+		//-------------------------------------  	
+		
+		if ($this->debug === TRUE)
+		{
+			$this->debug_msg = "<!-- DEBUG INFO:\n\n".$plist."\n END DEBUG-->\n";
+		}
+		
+		return $r;
+	}
+
+	//-------------------------------------
+	//  Executes the Method
+	//-------------------------------------
+	
+	function _execute($m)
+	{
+		$methName = $m->method_name;
+		
+		// Check to see if it is a system call
+		// If so, load the system_methods
+		$sysCall = ereg("^system\.", $methName);
+		$methods = $sysCall ? $this->system_methods : $this->methods;
+		
+		//-------------------------------------
+		//  Check for Function
+		//-------------------------------------
+		
+		if (!isset($methods[$methName]['function']))
+		{
+			return new XML_RPC_Response(0,
+				$this->xmlrpcerr['unknown_method'],
+				$this->xmlrpcstr['unknown_method']);
+		}
+		else
+		{
+			// See if we are calling function in an object
+			
+			$method_parts = explode(".",$methods[$methName]['function']);
+			$objectCall = (isset($method_parts['1']) && $method_parts['1'] != "") ? true : false;
+			
+			if ($objectCall && !is_callable(array($method_parts['0'],$method_parts['1'])))
+			{
+				return new XML_RPC_Response(0,
+				$this->xmlrpcerr['unknown_method'],
+				$this->xmlrpcstr['unknown_method']);
+			}
+			elseif (!$objectCall && !is_callable($methods[$methName]['function']))
+			{
+				return new XML_RPC_Response(0,
+					$this->xmlrpcerr['unknown_method'],
+					$this->xmlrpcstr['unknown_method']);
+			}		
+		}
+
+		//-------------------------------------
+		//  Checking Methods Signature
+		//-------------------------------------
+		
+		if (isset($methods[$methName]['signature']))
+		{
+			$sig = $methods[$methName]['signature'];
+			for($i=0; $i<sizeof($sig); $i++)
+			{
+				$current_sig = $sig[$i];
+		
+				if (sizeof($current_sig) == sizeof($m->params)+1)
+				{
+					for($n=0; $n < sizeof($m->params); $n++)
+					{
+						$p = $m->params[$n];
+						$pt = ($p->kindOf() == 'scalar') ? $p->scalartyp() : $p->kindOf();
+						
+						if ($pt != $current_sig[$n+1])
+						{
+							$pno = $n+1;
+							$wanted = $current_sig[$n+1];
+							
+							return new XML_RPC_Response(0,
+								$this->xmlrpcerr['incorrect_params'],
+								$this->xmlrpcstr['incorrect_params'] .
+								": Wanted {$wanted}, got {$pt} at param {$pno})");
+						}
+					}
+				}
+			}
+		}
+
+		//-------------------------------------
+		//  Calls the Function
+		//-------------------------------------
+
+		if ($objectCall)
+		{
+			if ($method_parts['1'] == "this")
+			{
+				return call_user_func(array($this, $method_parts['0']), $m);
+			}
+			else
+			{
+				$CI =& get_instance();
+				return $CI->$method_parts['1']($m);
+				//$class = new $method_parts['0'];
+				//return $class->$method_parts['1']($m);
+				//return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m);
+			}
+		}
+		else
+		{
+			return call_user_func($methods[$methName]['function'], $m);
+		}
+	}
+	
+	
+	//-------------------------------------
+	//  Server Function:  List Methods
+	//-------------------------------------
+	
+	function listMethods($m)
+	{
+		$v = new XML_RPC_Values();
+		$output = array();
+		foreach($this->$methods as $key => $value)
+		{
+			$output[] = new XML_RPC_Values($key, 'string');
+		}
+		
+		foreach($this->system_methods as $key => $value)
+		{
+			$output[]= new XML_RPC_Values($key, 'string');
+		}
+
+		$v->addArray($output);
+		return new XML_RPC_Response($v);
+	}
+	
+	//-------------------------------------
+	//  Server Function:  Return Signature for Method
+	//-------------------------------------
+		
+	function methodSignature($m)
+	{
+		$methName = $m->getParam(0);
+		$method_name = $methName->scalarval();
+		
+		$methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods;
+		
+		if (isset($methods[$method_name]))
+		{
+			if ($methods[$method_name]['signature'])
+			{
+				$sigs = array();
+				$signature = $methods[$method_name]['signature'];
+				
+				for($i=0; $i < sizeof($signature); $i++)
+				{
+					$cursig = array();
+					$inSig = $signature[$i];
+					for($j=0; $j<sizeof($inSig); $j++)
+					{
+						$cursig[]= new XML_RPC_Values($inSig[$j], 'string');
+					}
+					$sigs[]= new XML_RPC_Values($cursig, 'array');
+				}
+				$r = new XML_RPC_Response(new XML_RPC_Values($sigs, 'array'));
+			}
+			else
+			{
+				$r = new XML_RPC_Response(new XML_RPC_Values('undef', 'string'));
+			}
+		}
+		else
+		{
+			$r = new XML_RPC_Response(0,$this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']);
+		}
+		return $r;
+	}
+	
+	//-------------------------------------
+	//  Server Function:  Doc String for Method
+	//-------------------------------------
+	
+	function methodHelp($m)
+	{
+		$methName = $m->getParam(0);
+		$method_name = $methName->scalarval();
+		
+		$methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods;
+	
+		if (isset($methods[$methName]))
+		{
+			$docstring = isset($methods[$method_name]['docstring']) ? $methods[$method_name]['docstring'] : '';
+			$r = new XML_RPC_Response(new XML_RPC_Values($docstring, 'string'));
+		}
+		else
+		{
+			$r = new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']);
+		}
+		return $r;
+	}
+
+	//-------------------------------------
+	//  Server Function:  Multi-call
+	//-------------------------------------
+
+	function multicall($m)
+	{
+		$calls = $m->getParam(0);
+		list($a,$b)=each($calls->me);
+		$result = array();
+
+		for ($i = 0; $i < sizeof($b); $i++)
+		{
+			$call = $calls->me['array'][$i];
+			$result[$i] = $this->do_multicall($call);
+		}
+
+		return new XML_RPC_Response(new XML_RPC_Values($result, 'array'));
+	}
+	
+	
+	//-------------------------------------
+	//  Multi-call Function:  Error Handling
+	//-------------------------------------
+
+	function multicall_error($err)
+	{
+		$str  = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString();
+		$code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode();
+		
+		$struct['faultCode'] = new XML_RPC_Values($code, 'int');
+		$struct['faultString'] = new XML_RPC_Values($str, 'string');
+	
+		return new XML_RPC_Values($struct, 'struct');
+	}
+	
+	
+	//-------------------------------------
+	//  Multi-call Function:  Processes method
+	//-------------------------------------
+	
+	function do_multicall($call)
+	{
+		if ($call->kindOf() != 'struct')
+			return $this->multicall_error('notstruct');
+		elseif (!$methName = $call->me['struct']['methodName'])
+			return $this->multicall_error('nomethod');
+		
+		list($scalar_type,$scalar_value)=each($methName->me);
+		$scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type;
+			
+		if ($methName->kindOf() != 'scalar' || $scalar_type != 'string')
+			return $this->multicall_error('notstring');
+		elseif ($scalar_value == 'system.multicall')
+			return $this->multicall_error('recursion');
+		elseif (!$params = $call->me['struct']['params'])
+			return $this->multicall_error('noparams');
+		elseif ($params->kindOf() != 'array')
+			return $this->multicall_error('notarray');
+			
+		list($a,$b)=each($params->me);
+		$numParams = sizeof($b);
+
+		$msg = new XML_RPC_Message($scalar_value);
+		for ($i = 0; $i < $numParams; $i++)
+		{
+			$msg->params[] = $params->me['array'][$i];
+		}
+
+		$result = $this->_execute($msg);
+
+		if ($result->faultCode() != 0)
+		{
+			return $this->multicall_error($result);
+		}
+
+		return new XML_RPC_Values(array($result->value()), 'array');
+	}	
+	
+}
+// END XML_RPC_Server class
+
 ?>
\ No newline at end of file
